package org.exteen.lib;

import org.exteen.exec.ExteenPathChangeException;
import org.exteen.output.FlatExteenStream;
import org.exteen.tag.core.ChooseTag;
import org.exteen.tag.core.DumpTag;
import org.exteen.tag.core.FlatStreamFormattingTag;
import org.exteen.tag.core.ForEachTag;
import org.exteen.tag.core.IfTag;
import org.exteen.tag.core.IncludeTag;
import org.exteen.tag.core.InvokeBodyTag;
import org.exteen.tag.core.LoopInterruptingTag;
import org.exteen.tag.core.NewTag;
import org.exteen.tag.core.OtherwiseTag;
import org.exteen.tag.core.RootTag;
import org.exteen.tag.core.SetTag;
import org.exteen.tag.core.TagTag;
import org.exteen.tag.core.TaglibTag;
import org.exteen.tag.core.WhenTag;

public class CoreTagLibrary extends JavaTagLibrary {

    public CoreTagLibrary(String id) {
        super(id);
        // tags
        addTag("script", new RootTag());
        addTag("set", new SetTag());
        addTag("new", new NewTag());
        addTag("dump", new DumpTag());
        addTag("include", new IncludeTag());
        // dynamic tags...
        addTag("taglib", new TaglibTag());
        addTag("tag", new TagTag());
        addTag("invokeBody", new InvokeBodyTag());
        // looping and branching...
        addTag("if", new IfTag());
        addTag("choose", new ChooseTag());
        addTag("when", new WhenTag());
        addTag("otherwise", new OtherwiseTag());
        addTag("forEach", new ForEachTag());
        addTag("break", new LoopInterruptingTag(ExteenPathChangeException.Type.BREAK));
        addTag("continue", new LoopInterruptingTag(ExteenPathChangeException.Type.CONTINUE));
        // streaming...
        addTag("trim", new FlatStreamFormattingTag(FlatExteenStream.TrimType.FULL));
        addTag("notrim", new FlatStreamFormattingTag(FlatExteenStream.TrimType.NONE));
    }

}
